(() => {
  class Animal {
    name: string
    age: number
    constructor(name: string, age: number) {
      this.name = name
      this.age = age
    }

    say() {
      console.log("我是动物");
    }
  }

  class Dog extends Animal {
    sex: number
    constructor(name: string, age: number, sex: number) {
      super(name, age)
      this.sex = sex
    }
    say(): void {
      super.say()
    }
  }

  const dog = new Dog('cz', 29, 0)

  console.log(dog); //Dog {name: 'cz', age: 29, sex: 0}
  dog.say()




})()